package model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.codehaus.jackson.annotate.JsonIgnore;

@Entity
@Table(name = "HORAIRE_AVION")
public class HoraireAvion {
	private int id;
	private String date;
	private String depart;
	private String compagnie;
	private String vols;
	private String destination;
	private String via;
	private String etat;
	private VoyageAvion voyageAvion;

	public HoraireAvion() {
	}

	public HoraireAvion(String date, String depart, String compagnie,
			String vols, String destination, String via, String etat,
			VoyageAvion voyageAvion) {
		this.date = date;
		this.depart = depart;
		this.compagnie = compagnie;
		this.vols = vols;
		this.destination = destination;
		this.via = via;
		this.etat = etat;
		this.voyageAvion = voyageAvion;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "HORAIRE_AVION_ID")
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column(name = "DATE")
	public String getDate() {
		return date;
	}

	public void setDate(String date) {
		this.date = date;
	}

	@Column(name = "DEPART")
	public String getDepart() {
		return depart;
	}

	public void setDepart(String depart) {
		this.depart = depart;
	}

	@Column(name = "COMPAGNIE")
	public String getCompagnie() {
		return compagnie;
	}

	public void setCompagnie(String compagnie) {
		this.compagnie = compagnie;
	}

	@Column(name = "VOLS")
	public String getVols() {
		return vols;
	}

	public void setVols(String vols) {
		this.vols = vols;
	}

	@Column(name = "DESTINATION")
	public String getDestination() {
		return destination;
	}

	public void setDestination(String destination) {
		this.destination = destination;
	}

	@Column(name = "VIA")
	public String getVia() {
		return via;
	}

	public void setVia(String via) {
		this.via = via;
	}

	@Column(name = "ETAT")
	public String getEtat() {
		return etat;
	}

	public void setEtat(String etat) {
		this.etat = etat;
	}

	@ManyToOne
	@JoinColumn(name = "VOYAGE_AVION_ID")
	@JsonIgnore
	public VoyageAvion getVoyageAvion() {
		return voyageAvion;
	}

	public void setVoyageAvion(VoyageAvion voyageAvion) {
		this.voyageAvion = voyageAvion;
	}

	@Override
	public String toString() {
		return "HoraireAvion [date=" + date + ", depart=" + depart
				+ ", compagnie=" + compagnie + ", vols=" + vols
				+ ", destination=" + destination + ", via=" + via + ", etat="
				+ etat + "]";
	}

}
